package com.scorpio.order.mapper;

import com.scorpio.common.dao.BaseDao;
import com.scorpio.order.domain.OrderEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单Mapper接口
 *
 * @author scorpio
 * @date 2021-11-29
 */
@Mapper
public interface OrderMapper extends BaseDao<OrderEntity> {

    int countByStatus(@Param("uid") Long uid, @Param("status") String status);

    List<OrderEntity> appList(
            @Param("uid") Long uid
            , @Param("status") String status
            , @Param("offset") Integer offset
            , @Param("limit") Integer limit
    );

    List<OrderEntity> selectByStatus(@Param("status") String status);

    OrderEntity selectOrderSn(@Param("orderSn") String orderSn);

    List<OrderEntity> scanOverdueb();

    List<OrderEntity> timeoutOrders();

    int updateLogisticsInfo(
            @Param("id") Long id
            , @Param("logisticsNumber") String logisticsNumber
            , @Param("logisticsType") String logisticsType);


    int updateSendOut(
            @Param("id") Long id
            , @Param("logisticsNumber") String logisticsNumber
            , @Param("logisticsType") String logisticsType);

    //更新自提发货完成
    int updateSendZtOut(@Param("id") Long id, @Param("logisticsType") String logisticsType);

    int updateStatus(@Param("id") Long id, @Param("status") String status);

    int updateLoseEfficacy(@Param("orderSn") String orderSn);

    int updateOrderMoney(@Param("id") Long id, @Param("money") Float money);

    int updateOrderSn(@Param("id") Long id, @Param("orderSn") String orderSn);
}
